package ALT.entities;

import java.util.ArrayList;
import java.util.List;

public class Forum {
    private static int COUNTER = 0;

    private String mOID;
    private String mTitle;
    private String mCategory;

    private List<Entry> entries;
    private List<Member> members;

    public Forum(String category, String title) {
            this.mOID = String.valueOf(COUNTER++);
            this.mTitle = title;
            this.mCategory = category;
            this.entries = new ArrayList<Entry>();
            this.members = new ArrayList<Member>();
    }

    public void addEntry(Entry e) {
            entries.add(e);
    }

    public void removeEntry(Entry e) {
            entries.remove(e);
    }

    public void addMember(Member m) {
            members.add(m);
    }

    public void removeMember(Member m) {
            members.remove(m);
    }

    /**
     * @return the mOID
     */
    public String getmOID() {
            return mOID;
    }

    /**
     * @return the mTitle
     */
    public String getmTitle() {
            return mTitle;
    }

    /**
     * @param mTitle the mTitle to set
     */
    public void setmTitle(String mTitle) {
            this.mTitle = mTitle;
    }

    /**
     * @return the entries
     */
    public List<Entry> getEntries() {
            return entries;
    }

    /**
     * @return the members
     */
    public List<Member> getMembers() {
            return members;
    }
	

    /**
     * @return the mCategory
     */
    public String getmCategory() {
        return mCategory;
    }

    /**
     * @param mCategory the mCategory to set
     */
    public void setmCategory(String mCategory) {
        this.mCategory = mCategory;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + (this.mOID != null ? this.mOID.hashCode() : 0);
        hash = 47 * hash + (this.mTitle != null ? this.mTitle.hashCode() : 0);
        hash = 47 * hash + (this.mCategory != null ? this.mCategory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Forum other = (Forum) obj;
        if ((this.mOID == null) ? (other.mOID != null) : !this.mOID.equals(other.mOID)) {
            return false;
        }
        if ((this.mTitle == null) ? (other.mTitle != null) : !this.mTitle.equals(other.mTitle)) {
            return false;
        }
        if ((this.mCategory == null) ? (other.mCategory != null) : !this.mCategory.equals(other.mCategory)) {
            return false;
        }
        return true;
    }
    
    
}
